package io.github.lee.core.util

import android.content.Context
import android.view.View
import android.view.inputmethod.InputMethodManager


fun hideSoftKeyboard(view: View?) {
    if (null == view) {
        return
    }
    val context = view.context
    val service = context.getSystemService(Context.INPUT_METHOD_SERVICE)
    if (service is InputMethodManager) {
        service.hideSoftInputFromWindow(view.windowToken, 0)
    }
}